package com.eling.elcms.travel.model;


import com.eling.elcms.core.dao.annotation.Between;
import com.eling.elcms.core.dao.hibernate.search.EnumBridge;
import com.eling.elcms.core.model.BaseModel;
import com.eling.elcms.system.model.CommonUser;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.FieldBridge;

import javax.persistence.*;
import java.util.Date;

/**
 * travel交接班
 * 
 * @author
 * 
 */
@Entity
@Table(name = "travel_shiftchange")
public class ShiftChange extends BaseModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 3871749231700068079L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long pkShiftChange;

	/** 交接班事宜（夜班） */
	@Column(length = 1023)
	private String nightShiftAttention;

	/** 交接班事宜（次日班） */
	@Column(length = 1023)
	private String dayShiftAttention;

	/** 接班秘书 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "startWork_user")
	private CommonUser startWork_user;

	/** 交班秘书 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "finishWork_user")
	private CommonUser finishWork_user;

	/** 接班时间 */
	@Column
	@Between
	@Field
	private Date startWorkDate;

	/** 交班时间 */
	@Column
	@Between
	@Field
	private Date finishWorkDate;

	@Version
	private Integer version;

	/** 物资交换 */
	@Column(length = 1023)
	private String exchangeGoods;
	/** 周知事宜 */
	@Column(length = 1023)
	private String matters;
	/** 交接班状态*/
	@Enumerated(EnumType.STRING)
	@Field
	@FieldBridge(impl = EnumBridge.class)
	private ChangeStatus changeStatus;
	
	public static enum ChangeStatus {
		Receive("接班"), 
		Send("交班"); 

		private String display;

		ChangeStatus(String display) {
			this.display = display;
		}

		public String getDisplay() {
			return display;
		}
	}

	public Long getPkShiftChange() {
		return pkShiftChange;
	}

	public void setPkShiftChange(Long pkShiftChange) {
		this.pkShiftChange = pkShiftChange;
	}

	public String getNightShiftAttention() {
		return nightShiftAttention;
	}

	public void setNightShiftAttention(String nightShiftAttention) {
		this.nightShiftAttention = nightShiftAttention;
	}

	public String getDayShiftAttention() {
		return dayShiftAttention;
	}

	public void setDayShiftAttention(String dayShiftAttention) {
		this.dayShiftAttention = dayShiftAttention;
	}
	

	public Date getStartWorkDate() {
		return startWorkDate;
	}

	public void setStartWorkDate(Date startWorkDate) {
		this.startWorkDate = startWorkDate;
	}

	public Date getFinishWorkDate() {
		return finishWorkDate;
	}

	public void setFinishWorkDate(Date finishWorkDate) {
		this.finishWorkDate = finishWorkDate;
	}

		public CommonUser getStartWork_user() {
		return startWork_user;
	}

	public void setStartWork_user(CommonUser startWork_user) {
		this.startWork_user = startWork_user;
	}

	public CommonUser getFinishWork_user() {
		return finishWork_user;
	}

	public void setFinishWork_user(CommonUser finishWork_user) {
		this.finishWork_user = finishWork_user;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public String getExchangeGoods() {
		return exchangeGoods;
	}

	public void setExchangeGoods(String exchangeGoods) {
		this.exchangeGoods = exchangeGoods;
	}

	public String getMatters() {
		return matters;
	}

	public void setMatters(String matters) {
		this.matters = matters;
	}

	public ChangeStatus getChangeStatus() {
		return changeStatus;
	}

	public void setChangeStatus(ChangeStatus changeStatus) {
		this.changeStatus = changeStatus;
	}

}
